home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / INSERT LASTINDEXOF.SCRIPT < prev    next >
Encoding:
Text File  |  1998-01-06  |  794 b   |  29 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. // Insert script helper for:
  5.  
  6. /**
  7. @Object: String 
  8. @Method: lastIndexOf - returns the character index of the of 
  9. of the substring starting from the end of the string.  The 
  10. search starts at the end of the string or at the 
  11. character position specified by start. If the substring is not found 
  12. the value -1 is returned. 
  13. @Syntax: string.lastIndexOf(substring, [start])
  14. @Summary: lastIndexOf - returns the character index where the match was found
  15. */
  16.  
  17. function DoCommand()
  18. {
  19.   var editor = getActiveEditor();
  20.   if (editor)
  21.   {
  22.     var selection = editor.getSelection();
  23.     editor.replace("string.lastIndexOf(substring, [start])", selection);
  24.     editor.setActive("Insert string.lastIndexOf");
  25.   }
  26. }
  27.  
  28. !!/Script
  29.